<template>
  <aside class="admin-sider">
    <div class="logo">🦄 <span>Q后台</span></div>
    <ul class="menu">
      <li :class="{active: isActive('banner')}" @click="goTo('banner')">
        <span class="icon">🖼️</span> 轮播图管理
      </li>
      <li :class="{active: isActive('product')}" @click="goTo('product')">
        <span class="icon">🛒</span> 商品管理
      </li>
<!--      <li :class="{active: isActive('category')}" @click="goTo('category')">-->
<!--        <span class="icon">📂</span> 分类管理-->
<!--      </li>-->
      <li :class="{active: isActive('help')}" @click="goTo('help1')">
        <span class="icon">💬</span> 帮助中心回复管理
      </li>
    </ul>
  </aside>
</template>

<script lang="ts" setup>
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
function goTo(path: string) {
  if (!route.path.endsWith(path)) {
    router.push({ path: path })
  }
}
function isActive(path: string) {
  return route.path.endsWith(path)
}
</script>

<style scoped>
.admin-sider {
  width: 220px;
  background: #f6faff;
  color: #234;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 32px;
  height: 100vh;
  border-top-right-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: 4px 0 24px 0 rgba(120, 160, 255, 0.08);
  border-right: 1.5px solid #e3eaf5;
}
.logo {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 36px;
  letter-spacing: 2px;
  color: #2563eb;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
}
.menu {
  list-style: none;
  padding: 0;
  width: 100%;
}
.menu li {
  padding: 14px 32px;
  margin: 8px 0;
  border-radius: 14px 0 0 14px;
  cursor: pointer;
  font-size: 16px;
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.menu li .icon {
  font-size: 20px;
}
.menu li.active, .menu li:hover {
  background: #e3edfa;
  color: #2563eb;
  transform: translateX(4px);
}
</style>
